import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:fzcgx_app/common/adapter_utils.dart';

import 'package:fzcgx_app/common/assets_utils.dart';


import 'package:fzcgx_app/ui/guide_page.dart';
import 'package:fzcgx_app/ui/tabbar_page.dart';
import 'package:nav_router/nav_router.dart';

class LaunchPage extends StatefulWidget {
  @override
  _LaunchPageState createState() => _LaunchPageState();
}

class _LaunchPageState extends State<LaunchPage> {
  @override
  void initState() {
    Future.delayed(Duration(seconds: 3), () {
      bool notShowGuide=SpUtil.getBool('notShowGuide');
      if(notShowGuide){
         pushAndRemoveUntil(TabbarPage());
      }else{
         pushAndRemoveUntil(GuidePage());
      }
      
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      body: Container(
          width: AdapterUtils.screenWidth(),
          height: AdapterUtils.screenHeight(),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              SizedBox(
                height: AdapterUtils.getHeight(147),
              ),
              Image.asset(
                AssetsUtils.getAssetsImagesPath('launch.png'),
                width: AdapterUtils.getWidth(202),
                height: AdapterUtils.getHeight(244),
                fit: BoxFit.fitHeight,
              ),
              Column(
                children: <Widget>[
                  Image.asset(
                    AssetsUtils.getAssetsImagesPath('logo.png'),
                    width: AdapterUtils.getWidth(60),
                    height: AdapterUtils.getHeight(60),
                    fit: BoxFit.cover,
                  ),
                  SizedBox(
                    height: AdapterUtils.getHeight(15),
                  ),
                  Text(
                    '服装产供销',
                    style: TextStyle(
                      fontSize: AdapterUtils.getSp(14),
                      color: Color(0xffC1C0C2),
                      fontWeight: FontWeight.w500,
                    ),
                  ),
                  SizedBox(
                    height: AdapterUtils.getHeight(38),
                  ),
                ],
              ),
            ],
          )),
    );
  }
}
